import java.util.Random;
import java.util.Scanner;

public class random4 {
    public static int getN(){
        System.out.println("请输入随机数的个数：");
        Scanner scan = new Scanner(System.in);
        return scan.nextInt();
    }//获取用户输入
    public static float[] generateRandomNum(int n){
        float[] RandomNum = new float[n];
        Random random = new Random();

        for(int i = 0;i < RandomNum.length - 1;i ++){
            float Num = random.nextInt(0,200);
            RandomNum[i] = (Num / 100) - 1;
        }
        RandomNum[RandomNum.length - 1] = 1 - arraysSum(RandomNum);
        return RandomNum;
    }//获取随机数数组
    public static float arraysSum(float[] arr){
        float sum = 0;
        for (int i = 0;i < arr.length ;i ++) {
            sum += arr[i];
        }
        return sum;
    }//求随机数数组中元素的和
    public static void myToString(float[] a) {

        int iMax = a.length - 1;
        if (iMax == -1)
            System.out.println(" ");
        for(int i = 0;i < a.length;i ++) {
                System.out.printf("%.2f ",a[i]);
        }
    }//打印随机数数组
    public static void main(String[] args) {
        myToString(generateRandomNum(getN()));
    }
}
